package org.bigtree.example.model.vo;

import lombok.Data;
import org.bigtree.example.constans.GenderEnum;
import org.bigtree.example.entity.Employ;
import org.springframework.beans.BeanUtils;

import java.time.LocalDate;
import java.util.Objects;

/**
 * @author bigTree
 * @since 2025/6/12
 */
@Data
public class EmployVo {
    private Long id;
    private String name;
    private GenderEnum gender;
    private String phone;
    private String address;
    private LocalDate birthday;

    public static EmployVo of(Employ employ) {
        EmployVo employVo = new EmployVo();
        if (Objects.nonNull(employ)) {
            BeanUtils.copyProperties(employ, employVo);
        }
        return employVo;
    }
}
